package yagwl.client.model.demo;

import java.util.List;

import yagwl.client.model.ItemDTO;
import yagwl.client.model.TreeNodeDTO;
import yagwl.client.model.fnd.RpcStatus;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * The async counterpart of <code>CatalogService</code>.
 */
public interface CatalogRpcServiceAsync {
  // tree management
  void getCategoryTree(AsyncCallback<TreeNodeDTO> c);
  void createCategory(TreeNodeDTO category, AsyncCallback<RpcStatus> c);
  void updateCategory(TreeNodeDTO category, AsyncCallback<RpcStatus> c);
  void deleteCategorySubTree(String id, AsyncCallback<RpcStatus> c);
  void addProduct(String categoryId, String productId, AsyncCallback<RpcStatus> c);
  void removeProduct(String categoryId, String productId, AsyncCallback<RpcStatus> c);
  // products management
  void getProducts(AsyncCallback<List<ItemDTO>> c);
  void createProduct(ItemDTO product, AsyncCallback<RpcStatus> c);
  void updateProduct(ItemDTO product, AsyncCallback<RpcStatus> c);
  void deleteProduct(String id, AsyncCallback<RpcStatus> c);
}
